﻿using System;
using Gtk;
using RedCorona.Net;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Net.Sockets;
using System.Threading;
using Silmoon;
using Silmoon.Threading;

namespace Levi.Finance.Client
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			Startup startup = new Startup();
			startup.Start();
		}
	}
	
	public class Startup
	{
		public ABC f;

		public Startup ()
		{
			f = new ABC ();
			f.OnOutputTextMessage += new Silmoon.MySilmoon.OutputTextMessageHandler (f_OnOutputTextMessage);
			//f.Start();
		}

		public Startup (bool nooutput)
		{
			f = new ABC ();
			if (nooutput)
				f.OnOutputTextMessage += new Silmoon.MySilmoon.OutputTextMessageHandler (f_OnOutputTextMessage);
		}

		void f_OnOutputTextMessage (string message, int flag)
		{
			if (flag == -1)
				Console.ForegroundColor = ConsoleColor.Red;
			if (flag == 1)
				Console.ForegroundColor = ConsoleColor.Green;
			Console.WriteLine (message);
			Console.ResetColor ();
		}

		public void Start ()
		{			
			f.Start ();
		}

		public void Stop ()
		{
			f.Stop ();
		}
	}
}
